home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / lamstex / inputs / lamstex.stb (.txt) < prev    next >
LaTeX Document  |  1991-09-06  |  11KB  |  314 lines

  1. % LAMSTEX.STB  VERSION 2.0
  2. % COPYRIGHT (C) 1989, 1990, 1991 BY THE TEXPLORATORS CORPORATION
  3. % ALL RIGHTS RESERVED
  4. % THIS FILE SHOULD NOT BE CHANGED IN ANY WAY. 
  5. \catcode`\@=11
  6. \let\alloc@\alloc@@
  7. \def\adjustpunct@#1{\count@\lastkern
  8.  \ifnum\count@=\z@#1\else
  9.  \ifnum\count@>\tw@#1\else
  10.  \ifnum\count@<-\tw@#1\else
  11.   \unkern\unkern\setboxzl@
  12.   \skip@\lastskip\unskip
  13.   \count@@\lastpenalty\unpenalty
  14.   \ifnum\count@=\tw@\unskip\setboxzl@\fi
  15.   \ifdim\skip@=\z@\else\hskip\skip@\fi
  16.   #1%
  17.   \ifnum\count@=\tw@\null\hfill\fi
  18.   \penalty\count@@
  19.  \fi\fi\fi}
  20. \def\ignorepars@{\FNSS@\ignorepars@@}
  21. \def\ignorepars@@{\ifx\next\par\DN@\par{\FN@\ignorepars@@}\else
  22.  \let\next@\relax\fi\next@}
  23. \newcount\ctype@
  24. \newcount\Ctype@
  25. \newif\ifleftcolbreak@
  26. \def\cbreak@#1#2{\ifcase\ctype@#1\or\nobreak#2\else
  27.  \global\leftcolbreak@true
  28.  \ifdim\pagetotal>\pageheight@\global\leftcolbreak@false\fi
  29.  \global\Ctype@\ctype@\break\fi\ctype@\z@}
  30. \newif\ifshortlastcolumn@
  31. \newif\ifletter@
  32. \newtoks\marktoks@i
  33. \newtoks\marktoks@ii
  34. \newtoks\marktoks@iii
  35. \newtoks\marktoks@iv
  36. \newtoks\marktoks@v
  37. \newif\ifentry@
  38. \newcount\dii@
  39. \def\Topage@#1#2{\DN@{#2}\ifx\next@\frompage@\pagecs@{\frompage@}%
  40.  \else\pagecs@{\frompage@\hbox{--}#2}\fi\egroup\ignorepars@}
  41. \newdimen\pageheight@
  42. \pageheight@\vsize
  43. \newdimen\doublepageheight@
  44. \doublepageheight@2\pageheight@
  45. \advance\doublepageheight@1pc
  46. \newdimen\pagewidth@
  47. \pagewidth@\hsize
  48. \def\makeheadline{\vbox to\z@{\vskip-22.5pt\hbox to\pagewidth@
  49.  {\vbox to8.5\p@{}\the\headline}\vss}\nointerlineskip}%
  50. \def\makefootline{\baselineskip24\p@\hbox to\pagewidth@{\the\footline}}%
  51. \newif\iffirstindexpage@
  52. \def\makeindex{\checkmainfile@\par\vfill\break
  53.  \begingroup
  54.  \let\asterisk*%
  55.  \def\lkerns@{\null\kern\m@ne sp\kern\@ne sp}%
  56.  \def\nkerns@{\null\kern-\tw@ sp\kern\tw@ sp}%
  57.  \def\nocolumnbreak{\ctype@\@ne}%
  58.  \def\columnbreak{\ctype@\tw@}%
  59.  \def\newcolumn{\ctype@\thr@@}%
  60.  \def\shortlastcolumn{\shortlastcolumn@true}%
  61.  \def\LETTER##1{\par
  62.   \mark{}%
  63.   \cbreak@{\penalty-200 \bigskip}\bigskip
  64.   \letter@true\centerline{\bf##1}\nobreak\medskip}%
  65.  \def\Entry##1##2##3##4##5##6##7{\par\entry@true
  66.   \marktoks@i{##3}\marktoks@ii{##4}\marktoks@iii{##5}%
  67.    \marktoks@iv{##6}\marktoks@v{##7}%
  68.   \ifcase##1%
  69.   \or
  70.    \ifletter@\else\mark{}\fi
  71.     \cbreak@\relax\relax
  72.     \noindent@
  73.     \mark{10{\the\marktoks@i}}%
  74.     \hangafter\@ne\hangindent.5em{##3}%
  75.   \or
  76.    \ifcase##2%
  77.     \ifletter@\else\mark{}\fi
  78.     \cbreak@\relax\relax
  79.     \noindent@
  80.     \mark{20{\the\marktoks@i}{\the\marktoks@ii}}%
  81.     \hangafter\@ne\hangindent.5em{##3}\par\nobreak
  82.     \noindent@\hangafter\@ne\hangindent1.5em\quad{##4}%
  83.    \or
  84.     \mark{10{\the\marktoks@i}}%
  85.     \cbreak@\relax\relax
  86.     \noindent@
  87.     \mark{21{\the\marktoks@i}{\the\marktoks@ii}}%
  88.     \hangafter\@ne\hangindent1.5em\quad{##4}%
  89.    \fi
  90.   \or
  91.    \ifcase##2%
  92.     \ifletter@\else\mark{}\fi
  93.     \cbreak@\relax\relax
  94.     \noindent@
  95.     \mark{30{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}}%
  96.     \hangafter\@ne\hangindent.5em{##3}\par\nobreak
  97.     \noindent@\hangafter\@ne\hangindent1.5em\quad{##4}\par\nobreak
  98.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}%
  99.    \or
  100.     \mark{10{\the\marktoks@i}}%
  101.     \cbreak@\relax\relax
  102.     \noindent@
  103.     \mark{31{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}}%
  104.     \hangafter\@ne\hangindent1.5em\quad{##4}\par\nobreak
  105.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}%
  106.    \or
  107.     \mark{2\number\dii@{\the\marktoks@i}{\the\marktoks@ii}}%
  108.     \cbreak@\relax\relax
  109.     \noindent@
  110.     \mark{32{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}}%
  111.     \hangafter\@ne\hangindent2.5em\qquad{##5}%
  112.    \fi
  113.   \or
  114.    \ifcase##2%
  115.     \ifletter@\else\mark{}\fi
  116.     \cbreak@\relax\relax
  117.     \noindent@
  118.     \mark{40{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  119.      {\the\marktoks@iv}}%
  120.     \hangafter\@ne\hangindent.5em{##3}\par\nobreak
  121.     \noindent@\hangafter\@ne\hangindent1.5em\quad{##4}\par\nobreak
  122.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}\par\nobreak
  123.     \noindent@\hangafter\@ne\hangindent3.5em\qquad\quad{##6}%
  124.    \or
  125.     \mark{10{\the\marktoks@i}}%
  126.     \cbreak@\relax\relax
  127.     \noindent@
  128.     \mark{41{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  129.      {\the\marktoks@iv}}%
  130.     \noindent@\hangafter\@ne\hangindent1.5em\quad{##4}\par\nobreak
  131.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}\par\nobreak
  132.     \noindent@\hangafter\@ne\hangindent3.5em\qquad\quad{##6}%
  133.    \or
  134.     \mark{2\number\dii@{\the\marktoks@i}{\the\marktoks@ii}}%
  135.     \cbreak@\relax\relax
  136.     \noindent@
  137.     \mark{42{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  138.      {\the\marktoks@iv}}%
  139.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}\par\nobreak
  140.     \noindent@\hangafter\@ne\hangindent3.5em\qquad\quad{##6}%
  141.    \or
  142.     \mark{3\number\dii@{\the\marktoks@i}{\the\marktoks@ii}%
  143.      {\the\marktoks@iii}}%
  144.     \cbreak@\relax\relax
  145.     \noindent@
  146.     \mark{43{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  147.      {\the\marktoks@iv}}%
  148.     \hangafter\@ne\hangindent3.5em\qquad\quad{##6}%
  149.    \fi
  150.   \or
  151.    \ifcase##2%
  152.     \ifletter@\else\mark{}\fi
  153.     \cbreak@\relax\relax
  154.     \noindent@
  155.     \mark{50{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  156.      {\the\marktoks@iv}{\the\marktoks@v}}%
  157.     \hangafter\@ne\hangindent.5em{##3}\par\nobreak
  158.     \noindent@\hangafter\@ne\hangindent1.5em\quad{##4}\par\nobreak
  159.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}\par\nobreak
  160.     \noindent@\hangafter\@ne\hangindent3.5em\qquad\quad{##6}\par\nobreak
  161.     \noindent@\hangafter\@ne\hangindent4.5em\qquad\qquad{##7}%
  162.    \or
  163.     \mark{10{\the\marktoks@i}}%
  164.     \cbreak@\relax\relax
  165.     \noindent@
  166.     \mark{51{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  167.      {\the\marktoks@iv}{\the\marktoks@v}}%
  168.     \hangafter\@ne\hangindent1.5em\quad{##4}\par\nobreak
  169.     \noindent@\hangafter\@ne\hangindent2.5em\qquad{##5}\par\nobreak
  170.     \noindent@\hangafter\@ne\hangindent3.5em\qquad\quad{##6}\par\nobreak
  171.     \noindent@\hangafter\@ne\hangindent4.5em\qquad\qquad{##7}%
  172.    \or
  173.     \mark{2\number\dii@{\the\marktoks@i}{\the\marktoks@ii}}%
  174.     \cbreak@\relax\relax
  175.     \noindent@
  176.     \mark{52{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  177.      {\the\marktoks@iv}{\the\marktoks@v}}%
  178.     \hangafter\@ne\hangindent2.5em\qquad{##5}\par\nobreak
  179.     \noindent@\hangafter\@ne\hangindent3.5em\qquad\quad{##6}\par\nobreak
  180.     \noindent@\hangafter\@ne\hangindent4.5em\qquad\qquad{##7}%
  181.    \or
  182.     \mark{3\number\dii@{\the\marktoks@i}{\the\marktoks@ii}%
  183.      {\the\marktoks@iii}}%
  184.     \cbreak@\relax\relax
  185.     \noindent@
  186.     \mark{53{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  187.      {\the\marktoks@iv}{\the\marktoks@v}}%
  188.     \hangafter\@ne\hangindent3.5em\qquad\quad{##6}\par\nobreak
  189.     \noindent@\hangafter\@ne\hangindent4.5em\qquad\qquad{##7}%
  190.    \or
  191.     \mark{4\number\dii@{\the\marktoks@i}{\the\marktoks@ii}%
  192.      {\the\marktoks@iii}{\the\marktoks@iv}}%
  193.     \cbreak@\relax\relax
  194.     \noindent@
  195.     \mark{54{\the\marktoks@i}{\the\marktoks@ii}{\the\marktoks@iii}%
  196.      {\the\marktoks@iv}{\the\marktoks@v}}%
  197.     \hangafter\@ne\hangindent4.5em\qquad\qquad{##7}%
  198.    \fi
  199.   \fi
  200.   \dii@##2\relax
  201.   \letter@false
  202.   \ignorepars@}%
  203.  \def\Page##1{\ifentry@\adjustpunct@,\enspace\else\adjustpunct@, \fi
  204.   \entry@false{##1}\ignorepars@}%
  205.  \def\Pagespan##1{\ifentry@\adjustpunct@,\enspace\else\adjustpunct@, \fi
  206.   \entry@false\def\frompage@{##1}{##1}\ignorepars@}%
  207.  \def\Topage##1{\DN@{##1}\ifx\next@\frompage@
  208.   \else\hbox{--}{##1}\fi\ignorepars@}%
  209.  \def\PageSpan##1##2{\ifentry@\adjustpunct@,\enspace\else\adjustpunct@, \fi
  210.   \entry@false\def\pagecs@{##1}\def\frompage@{##2}%
  211.   \bgroup\let\Topage\Topage@\ignorepars@}%
  212.  \def\Xref##1{\ifentry@\else
  213.   \def\See####1{\adjustpunct@\semicolon@\space
  214.   {\it see~also\/}~####1}{##1}\fi\ignorepars@}%
  215.  \def\Morexref##1{\ifentry@\else
  216.   \def\See####1{\adjustpunct@, ####1}{##1}\fi\ignorepars@}%
  217.  \def\Entryxref##1##2##3##4##5##6##7##8{%
  218.   \Entry{##1}{##2}{##3}{##4}{##5}{##6}{##7}%
  219.  \def\See####1{\adjustpunct@, {\it see\/}~####1}{##8}\ignorepars@}%
  220.  \hsize3in
  221.  \global\vsize\doublepageheight@
  222.  \maxdepth\maxdimen
  223.  \global\firstindexpage@true
  224.  \global\advance\vsize-60\p@
  225.  \everypar{}\parindent\z@
  226.  \rightskip\z@ plus3em \spaceskip.3333em \xspaceskip.5em
  227.  \output{\doublecolumns@}%
  228.  \input\mainfile@.xdx
  229.  \mark{}%
  230.  \output{\balancecolumns@}\vfil\break\endgroup
  231.  \global\vsize\pageheight@}
  232. \def\makeindex@W{Index}
  233. \def\combinecolumns@{%
  234.  \setbox\outbox@\vbox{\makeheadline
  235.   \vbox to\pageheight@{\boxmaxdepth\maxdepth
  236.    \iffirstindexpage@
  237.     \vbox to30\p@{\vskip10\p@
  238.      \hbox to\pagewidth@{\hfil\bf\uppercase\expandafter{\makeindex@W}\hfil}%
  239.      \vfil}%
  240.     \nointerlineskip
  241.    \fi
  242.    \wd\z@\hsize\wd\tw@\hsize
  243.    \setboxz@h to\pagewidth@{\box\z@\kern.5in\box\tw@}%
  244.    \dimen@\dp\z@\box\z@\kern-\dimen@\vfill}%
  245.    \makefootline}%
  246.  {\noexpands@\let\style=\relax
  247.   \shipout@\box\outbox@
  248.  \global\vsize\doublepageheight@
  249.  \global\firstindexpage@false
  250.  \advancepageno}
  251. \newdimen\prevcoldepth@
  252. \def\doublecolumns@{%
  253.  \dimen@\pageheight@\iffirstindexpage@\advance\dimen@-30\p@\fi
  254.  \ifleftcolbreak@
  255.   \global\leftcolbreak@false
  256.   \vbox to\dimen@{\dimen@\dp\@cclv\unvbox\@cclv
  257.    \ifnum\Ctype@=\thr@@\kern-\dimen@\vfill\fi}%
  258.   \allowbreak
  259.  \else
  260.   \splittopskip\topskip\splitmaxdepth\maxdepth
  261.   \setbox\z@\vsplit\@cclv to\dimen@
  262.   \ifnum\Ctype@=\z@\global\Ctype@\@ne\fi
  263.   \ifcase\Ctype@\or
  264.    \setbox\tw@\vsplit\@cclv to\dimen@\global\prevcoldepth@\dp\tw@
  265.   \else
  266.    \global\prevcoldepth@\dp\@cclv
  267.    \setbox\tw@\vbox to\dimen@{\unvbox\@cclv
  268.     \ifnum\Ctype@=\thr@@\kern-\prevcoldepth@\vfill\fi}%
  269.   \fi
  270.   \combinecolumns@
  271.   \ifcase\Ctype@\or
  272.   \expandafter\continue@\splitbotmark{}\relax\relax\relax\relax
  273.    \relax\relax\continue@
  274.   \else\expandafter\continue@\botmark{}\relax\relax\relax\relax
  275.    \relax\relax\continue@
  276.   \fi
  277.   \ifvoid\@cclv\else\unvbox\@cclv\penalty\outputpenalty\fi
  278.  \global\Ctype@\z@}
  279. \def\continue@#1#2#3#4#5#6#7#8\continue@{\def\next@{#1}\ifx\next@\empty
  280.  \else
  281.   \noindent@#3 ({\it continued\/})\par
  282.   \ifnum#1>\@ne\noindent@\enspace(#4 {\it continued\/})\par\fi
  283.   \ifnum#1>\tw@\noindent@\enspace(#5 {\it continued\/})\par\fi
  284.   \ifnum#1>\thr@@\noindent@\enspace(#6 {\it continued\/})\par\fi
  285.   \ifnum#1>4 \noindent@\enspace(#7 {\it continued\/})\par\fi
  286.   \ifvoid\@cclv
  287.    \global\advance\prevcoldepth@-\prevdepth\kern\prevcoldepth@
  288.   \else
  289.    \skip@\baselineskip\advance\skip@\parskip
  290.    \advance\skip@-\topskip\advance\skip@-\prevdepth
  291.    \vskip\skip@
  292.   \fi
  293.  \fi}
  294. \def\balancecolumns@{\setbox\z@\vbox{\unvbox\@cclv\unskip}%
  295.  \dimen@\ht\z@\advance\dimen@\topskip\advance\dimen@-\baselineskip
  296.  \divide\dimen@\tw@
  297.  \splittopskip\topskip
  298.  \global\dimen@i\dimen@
  299.  {\vbadness\@M
  300.   \loop
  301.    \global\setbox\thr@@\copy\z@
  302.    \global\setbox\@ne\vsplit\thr@@ to\dimen@i
  303.    \ifdim\ht\thr@@>\dimen@i\global\advance\dimen@i\p@
  304.   \repeat}%
  305.  \setbox\z@\vbox to\dimen@i{\unvbox\@ne}%
  306.  \setbox\tw@\vbox to\dimen@i{\dimen@\dp\thr@@\unvbox\thr@@
  307.   \ifshortlastcolumn@\kern-\dimen@\vfill\fi}%
  308.  \combinecolumns@}
  309. \def\alloc@#1#2#3#4#5{\global\advance\count1#1by\@ne
  310.  \ch@ck#1#4#2\allocationnumber\count1#1
  311.  \global#3#5\allocationnumber
  312.  \wlog{\string#5\string#2\the\allocationnumber}}
  313. \catcode`\@=\active
  314.